package com.cloud.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.entity.SysLoginLogs;
import com.cloud.system.mapper.SysLoginLogsMapper;
import com.cloud.system.service.ISysLoginLogsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 登录日志记录
 *
 * @author yzj
 * @since 2022-05-13
 */
@Service
public class SysLoginLogsServiceImpl extends ServiceImpl<SysLoginLogsMapper, SysLoginLogs> implements ISysLoginLogsService {

    @Resource
    private SysLoginLogsMapper loginLogsMapper;

    /**
     * 登录日志记录分页
     *
     * @author yzj
     */
    @Override
    public List<SysLoginLogs> selectSysLogLoginList(SysLoginLogs query) {
        List<SysLoginLogs> list = loginLogsMapper.selectSysLogLoginList(query);
        return list;
    }

    /**
     * 登录日志记录新增
     *
     * @author yzj
     */
    @Override
    public int insert(SysLoginLogs entity) {
        return loginLogsMapper.insert(entity);
    }

    /**
     * 清空登录日志
     */
    @Override
    public void cleanLogLogin() {
        loginLogsMapper.cleanLogLogin();
    }

}
